<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div class="header">
	<h2>&nbsp;&nbsp;ad登录配置</h2>
</div>
<form action="app/appConfig/save" id="formAppConfig" method="post">
	<table class=" form-table">
		<tbody>
			<tr>
				<td class="td1">使用域密码登录：</td>
				<td class="td2"><input type="hidden" id="txtAdPasswordCheck"
					name="adPasswordCheck" value="${adPasswordCheck }" /> <c:choose>
						<c:when test="${'1' eq adPasswordCheck}">
							<input onchange="btnSaveAppConfigSubmit()" type="checkbox"
								id="cbAdPasswordCheck" value="1" checked="checked" />
						</c:when>
						<c:otherwise>
							<input onchange="btnSaveAppConfigSubmit()" type="checkbox"
								id="cbAdPasswordCheck" value="0" />
						</c:otherwise>
					</c:choose></td>
			</tr>

		</tbody>
	</table>
</form>

<script type="text/javascript">
	function btnSyncOnclick() {

		$.post("app/appConfig/syncFromLdap", function(data) {

			isperp.alert(data.data);

		});

	}

	function btnSaveAppConfigSubmit() {
		var v = $("#cbAdPasswordCheck:checked").val();

		if (v) {
			$("#txtAdPasswordCheck").val(1);
		} else {

			$("#txtAdPasswordCheck").val(0);
		}
		isperp.submitForm({
			formId : "formAppConfig",
			success : function(data) {
				if (!data.success) {
					isperp.alert(data.tata);
				}
			}
		});
	}
</script>

<div class="header">
	<h2>&nbsp;&nbsp;域列表</h2>
</div>

<isperp:grid url="app/ldapConfig/list" gridId="appLdapConfigGrid"
	ondbClickRowEvent="appLdapConfigGrid.edit(rowid);" pager="false"
	showPager="false" showSearchbar="false" showToolbar="true"
	cusDialogSize="normal" cusEditUrl="app/ldapConfig/edit"
	cusDeleteUrl="app/ldapConfig/delete">
	<jsp:attribute name="toolbar">
		<isperp:button icon="icon-plus" cssClass="nui-mainbtn" text="新增"
			onclick="appLdapConfigGrid.create();"></isperp:button>
		<button type="button" id="btnSync" onclick="btnSyncOnclick();"
			value="保存">&nbsp;&nbsp;&nbsp;马上同步&nbsp;&nbsp;&nbsp;</button>
	<isperp:toolbar id="userToolbar">
	 
	</isperp:toolbar>
	</jsp:attribute>
	<jsp:body>
	<isperp:column name="id" title="id" hidden="true"></isperp:column>
	<isperp:column name="host" title="地址" width="100">
	</isperp:column>
	<isperp:column name="port" title="端口" width="40">
	</isperp:column>
	<isperp:column name="dc" title="dc" width="60">
	</isperp:column>
	<isperp:column name="customerName" title="用户所属客户" width="100">
	</isperp:column>
	<isperp:column name="customerUserOu" title="用户信息节点" width="120">
	</isperp:column>
	</jsp:body>
</isperp:grid>
